import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from "@angular/router";
import { MyHttp } from "../../../../service/MyHttp";
import { GlobalVariable } from "../../../../global.config";
@Component({
  selector: 'app-groupdetail',
  templateUrl: './groupdetail.component.html',
  styleUrls: ['./groupdetail.component.css']
})
export class GroupdetailComponent implements OnInit {

  private groupId:string = ''; 
  public data:any;
  public doorType = ['小','中','大'];
  public policyType = GlobalVariable.POLICY_TYPE;
  constructor(private myHttp:MyHttp,private activeRoute:ActivatedRoute) {
    this.activeRoute.params.subscribe(params=>{
      if(params['groupId']){
        this.groupId = params['groupId'];
        this.getGroupDeatil();
      }
    });
   }

  ngOnInit() {
  }

  private getGroupDeatil(){
    this.myHttp.post('group/findOne',{group_id:this.groupId}).subscribe(res=>{
      if(res.errorCode==0){
        this.data = res.message;
      }
    },err=>{alert('群组信息获取失败')});
  }

}
